

<?php if(validation_errors()): ?>
<div class="tips tips-large tips-warning">
          
          <div class="tips-content">
            <p class="auxiliary-text">
             <span class="x-icon x-icon-small x-icon-error">×</span>&nbsp;&nbsp;提示:发生了以下问题,更正后继续
            </p>
            <p>
              <?php echo validation_errors();?>
            </p>
          </div>
</div>
<?php endif;?>

<h3>添加新闻</h3>
<script src="<?php echo base_url().$this->config->item('public');?>assets/js/edit.js"></script>
<script>
	//select 选择框选中多个值
	function setCategoryId(selectObj,hiddenObj){
		elementById(hiddenObj).value = getCheckVlue(selectObj);
	}
</script>


<?php 
	$attrbutes = array(
		'class' => 'form-horizontal',
		'onsubmit'=>"setCategoryId('category_id_checkbox','category_id')"
	);
	echo form_open('article/add',$attrbutes);
?>

	<ul class="bui-tab nav-tabs">
      <li class="active "><a href="#a">常规</a></li>
      <li><a href="#b">属性</a></li>
      <li><a href="#c">其他</a></li>
	</ul>
	
	 <hr>
	<div class="control-group">
	<?php
		echo form_label('标题','title',array('class'=>'control-label'));
		echo '<div class="controls">';
		echo form_input(array('name'=>'title','class'=>'input-large'));
		echo '</div>';
	?>
	</div>
	
	<div class="control-group">
		<?php
		echo form_label('状态','status',array('class'=>'control-label'));
		?>
		<div class="controls">
		<?php
			
			$radio = array(
				'name' => 'status',
				'checked' => true,
				'value' => 1
			);
			echo form_radio($radio); 
			echo form_label('启用','status');
		?>

		<?php
			
			$radio = array(
				'name' => 'status',
				'value' => 0
			);
			echo form_radio($radio); 
			echo form_label('不启用','status');
		?>
		</div>
	</div>
	
	<div class='control-group'>
	<?php
		echo form_label('所属分类','category_id_select',array('class'=>'control-label'));
		$cates = $this->category->getAllCategory2();
		echo "<div class='controls control-row-auto'>";
		
		$this->category->getTreeCheckbox($cates,'category_id_checkbox',0,0);
		echo "<input type='hidden' name='category_id' id='category_id'>";
		echo "</div>";
		
	?>
	</div>
	
	<div class='control-group'>
	<?php

		echo form_label('内容','text',array('class'=>'control-label'));
	?>
		<!--初始化内容编辑器-->
		<div class="offset2">
	<?php
		$editor = array(
			'name' => 'text',
			'id' => "content_text",
			'value' => '',
			'style' => "width:100%"	//,//附加的样式，重置模板默认样式
			// other ...
		);
		$this->load->view('plugin/kindeditor',$editor);
	?>
		</div>
	</div>
	
	<div class='actions-bar  centered'>
	<?php
		echo form_submit(array('class' => 'button button-primary', 'name' => 'submit', 'value' => '确认添加'));
		echo form_button(array('type' => 'reset','class' => 'button  offset1', 'name' => 'reset', 'content' => '重置'));
		
	?>
	</div>
	<?php echo form_close(); ?>
